package cn.kgc.springboot.controller;

import cn.kgc.springboot.entity.User;
import cn.kgc.springboot.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 课工场
 * @date 2024/8/14
 * @description
 */
@RestController
@RequestMapping("user")
public class UserController {

    @Resource
    private UserService userService;

    @GetMapping("one")
    public User  getUser(Integer id){

     return   userService.getOne(id);
  }

    @GetMapping("list")
    public List<User>  userList(){

        return   userService.userList();
    }
}
